<include file="Public/header" />
<body onselectstart="return false">
<style>
    .pop-imgshow{position:fixed;top:0;left:0;right:0;bottom:0;background: rgba(0,0,0,0.7);text-align: center;}
    .pop-imgshow span{display:inline-block;height:100%;vertical-align: middle;}
    .pop-imgshow img{max-width:80%;max-height:80%;vertical-align: middle;}
</style>
<div class="main">
    <div class="content">
        <div class="head-content">
            <div class="head-title">取件列表</div>
            <div class="head-search">
                <a href="<{:U('add')}>" class="form-button color-bg-yellow" >添加</a>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="head-content">
            <form action="<{:U('index')}>" method='get' id='search'>
                <div class="head-search">
					<select class="form-input-small" name="status" >
					<option value="">领取状态</option>
					<option <{:I('get.status') == 1 ? "selected" : ''}> value="1">未领取</option>
					<option <{:I('get.status') == 2 ? "selected" : ''}> value="2">已领取</option>
					</select>
                    <input class="form-input-small" type="text" value="<{:I('get.no')}>" name='no' placeholder="编号" />
                    <input class="form-input-small" type="text" value="<{:I('get.phone')}>" name='phone' placeholder="手机号" />
                    <input class="form-input-small" type="text" value="<{:I('get.name')}>" name='name' placeholder="姓名" />
                    <input type="text" id="take_time" name="take_time" value="" style="display: none" >
                    <button class="form-button color-bg-green">搜索</button>
                    <input onclick="send_mess()" class="form-button color-bg-green"  type="button" value="发短信" >
                    <input onclick="send_voice()" class="form-button color-bg-green"  type="button" value="发语音" >
                </div>
            </form>
        </div>
    </div>
    <div class="table-list">
        <table cellpadding="0" cellspacing="0" style="table-layout: fixed">
            <thead>
            <tr>
                <th>快件编号</th>
                <th>货柜编号</th>
                <th>取件人姓名</th>
                <th>取件人号码</th>
                <th>
                <div style="text-align: center;">
                	<span style="margin-top:13px;float: left;margin-left:33px ">取件时间</span>
                    <if condition="!I('get.take_time')">
                        <img style="height: 20px;width: 20px;cursor: pointer;" src="__PUBLIC__/Home/images/no_arrow.png" alt="" onclick="$('#take_time').val('desc');$('#search').submit()">
                    </if>
                    <if condition="I('get.take_time') == desc">
                        <img style="height: 20px;width: 20px;cursor: pointer;" src="__PUBLIC__/Home/images/down_arrow.png" alt="" onclick="$('#take_time').val('asc');$('#search').submit()">
                    </if>
                    <if condition="I('get.take_time') == asc">
                        <img style="height: 20px;width: 20px;cursor: pointer;" src="__PUBLIC__/Home/images/up_arrow.png" alt="" onclick="$('#take_time').val('desc');$('#search').submit()">
                    </if>  
                </div>
                
                </th>              
                <th>短信|语音</th>            
                <th>领取状态</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <foreach name='list' item='vo'>
                <tr >
                    <td><{$vo['no']}></td>
                    <td><{$vo['container']['no']}></td>
                    <td><{$vo['name']}></td>
                    <td><{:$vo['phone']}></td>
                    <td style="white-space:nowrap;"><{$vo['take_time']|default='未取件'}></td>           
                    <td style="font-style: inherit"><{$vo['mess_status']|get_post_mess_status}>|<{$vo['voice_status']|get_post_voice_status}></td>                
                    <td style="font-style: inherit"><{$vo['status']|get_post_status}></td>
                    <td style="white-space:nowrap;" ><{$vo['create_time']}></td>
                    <td>
                        <div class="operate-list">
                            <a class="heart" title='修改' href="<{:U('edit',array('id'=>$vo['id']))}>">
                                <i class="iconfont">&#xe64f;</i>
                            </a>
                            <a class="delete" title='删除' onclick="info(<{$vo['id']}>)" href="javascript:void(0)">
                                <i class="iconfont">&#xe62b;</i>
                            </a>
                        </div>
                    </td>
                </tr>
            </foreach>
        </table>

        <!--没有结果时显示-->
        <if condition="!$list" >
            <div class="nodata"><i class="iconfont">&#xe607;</i><span>没有查询到符合条件的记录</span></div>
        </if>

        <!--分页效果-->
        <div class="table-foot">
            <div class="foot-page">
                <ul><{$page}></ul>
            </div>
        </div>

    </div>
</div>

<!--提示框-->
<div class="pop-window pop-delete" id="info">
    <input type="hidden" name="id" id="id"   >
    <div class="pop-notice FromUpToDown">
        <div class="notice-head">
            <div class="notice-head-title">温馨提示</div>
            <div class="notice-head-delete">×</div>
        </div>
        <div class="notice-content">
            <div>
                <i class="iconfont">&#xe607;</i>
            </div>
            <div class="notice-content-word">是否要删除本条信息？</div>
        </div>
        <div class="notice-foot">
            <a href="javascript:;" onclick="del()" class="notice-btn btn-submit">确定</a>
            <a href="javascript:;" class="notice-btn btn-drop">取消</a>
        </div>
    </div>
</div>


<include file="Public/footer" />
<script>
    //弹出询问框
    function info(id){
        $("#id").val(id);
        $("#info").show();
    }

    //删除
    function del(){
        $('#info').hide();
        var id = $("#id").val();
        $.get(
                "<{:U('del')}>",
                {
                    id:id
                },
                function(res){
                    if(res.status == false){
                        layer.msg(res.info,{time:1000});
                    }else{
                        layer.msg(res.info,{time:1000});
                        setTimeout("location.reload()",1000);
                    }
                }
        );
    }

    function send_mess()
    {
       // $("#send_mess").show();
        layer.open({
            type: 2,
            title: '发送短信',
            shadeClose: true,
            shade: 0.8,
            area: ['500px', '443px'],
            content: "<{:U('sendList')}>"
        });
    }

    function send_voice()
    {
        layer.open({
        type: 2,
        title: '发送语音',
        shadeClose: true,
        shade: 0.8,
        area: ['500px', '443px'],
        content: "<{:U('voiceList')}>"
    });

    }

    
	
		$(".dizhi").hover(
			function(){
			if(!$(this).html()){
            return;
        }
		var that = this;
        layer.tips($(this).html(), that, {
            tips: [1, '#F2AA1C'],
            time: 4000
        });
			},
			function(){
			layer.closeAll();
					});
  

    function imgshow(obj){
        var background = obj.css("background-image");
        var reg = /"(.*)"/;
        var res = reg.exec(background);
        var popImgshow='<div onclick="$(this).remove();" class="pop-imgshow"><span></span><img src="'+res[1]+'"/></div>';
        $('body').append(popImgshow);
    }
</script>
</body>
</html>